﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.ComponentModel;

using System.Threading;
using ActivityTracker.Library;

using Common.Library;

namespace ActivityTracker.Views
{
    public partial class TimeSpentMenu : PhoneApplicationPage
    {
        #region constructor

        public TimeSpentMenu()
        {
            InitializeComponent();
        }

        #endregion

        #region page events

        private void ListBoxTimeSpentChartMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                if (ListBoxTimeSpentChartMenu.SelectedIndex != -1)
                {
                    string selitem = "";
                    selitem = (ListBoxTimeSpentChartMenu.SelectedItem as TextBlock).Text.ToString();
                    switch (selitem)
                    {
                        case "daily":
                            NavigationService.Navigate(new Uri("/Views/Charts/Daily/Daily_TimespentBarChart.xaml", UriKind.Relative));
                            break;
                        case "monthly":
                            NavigationService.Navigate(new Uri("/Views/Charts/Monthly/Monthly_TimeSpentBarChart.xaml", UriKind.Relative));
                            break;
                        case "yearly":
                            NavigationService.Navigate(new Uri("/Views/Charts/Yearly/Yearly_TimespentBarChart.xaml", UriKind.Relative));
                            break;
                       
                    }
                    ListBoxTimeSpentChartMenu.SelectedIndex = -1;
                }
            }
            catch (Exception ex)
            {
                string mess = "Exception in ListBoxTimeSpentChartMenu_SelectionChanged Method In TimeSpentMenu file.\n\n" + ex.Message + "\n\n Stack Trace:- " + ex.StackTrace;
                Exceptions.SaveOrSendExceptions(mess, ex);
            }
        }

        private void HelpImage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Views/Help/Help.xaml?id=7&url=Gg__yuN3z-U", UriKind.Relative));
           
        }

        #endregion
    }
}